<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>网上营业厅</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="bookmark" href="images/favicon.ico" type="image/x-icon" />

<link rel="stylesheet" href="../layui/css/layui.css" media="all">
<script type="text/javascript" src="../layui/lay/modules/layer.js"></script>
<script src="../layui/jquery-3.2.1.min.js" charset="utf-8"></script>
<script src="../layui/layui.js" charset="utf-8"></script>

</head>
<style type="text/css">
	body{
		background-size:100%,100%;
		overflow:hidden;
	}
</style>
<body background="../images/login.png">
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<br>
	<div align="center">
		<div id="left">
		<div align="center" class="layui-tab layui-tab-card " style="width: 40%;height: 40%">
			<ul class="layui-tab-title">
				<li><font size="3">请仔细填写注册信息</font></li>
			</ul>
			<div class="layui-tab-content">
				<div class="layui-tab-item layui-show">
			  <form id="form" class="layui-form" action="">
			    
					<label class="layui-form-label">单位账号 : </label>
					<div class="layui-input-inline" style="width: 75%">
						<input name="DWZH" id="DWZH" class="layui-input" type="text"autocomplete="off" lay-verify="required|number">
					</div>
					<br> <br> 
					<label class="layui-form-label">经办人手机 : </label>
					<div class="layui-input-inline" style="width: 75%">
						<input name="ylsjh" id="ylsjh" class="layui-input" type="text"autocomplete="off" lay-verify="required|number">
					</div>
					
					<br>
					<br>
					<label class="layui-form-label">短信验证码 : </label>
					<div class="layui-input-inline" style="width: 53%">
						<input name="dxyz" id="dxyz" class="layui-input" type="text"autocomplete="off" lay-verify="required|number">
					</div>
					
					<div class="layui-input-inline">
						<input id="fs" type="button" class="layui-btn layui-btn-primary" value="发送验证码">
					</div>
					
					<br> <br> 
					<label class="layui-form-label">您的密码 : </label>
					<div class="layui-input-inline" style="width: 75%">
						<input name="password" id="password" class="layui-input" type="password"autocomplete="off" lay-verify="required|number">
					</div>
					
					<br> <br> 
					<label class="layui-form-label">确认密码 : </label>
					<div class="layui-input-inline" style="width: 75%">
						<input name="qpassword" id="qpassword" class="layui-input" type="password"autocomplete="off" lay-verify="required|number">
					</div>
					
					
					<br>
					<br>
					</form>
					<div align="center">
					 	<input name="ck" value="ck" id="ck"  type="checkbox"><font size="3" color="red">我同意并遵守
					 	</font><a href="javascript:;" style="font-size: 1.2em; color: blue">《延边州住房公积金个人网上业务平台服务协议》</a><br>
					 	<input id="submit" type="button" class="layui-btn layui-btn-primary" value=" 注 &nbsp;&nbsp; 册 ">
					 	<input id="cz" type="button" class="layui-btn layui-btn-primary" value="返回登录界面">
					</div>
				</div>
			</div>
		</div>
	</div>
  </div>
	<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
	
	<script>
		layui.use('element', function() {
			var $ = layui.jquery, element = layui.element; //Tab的切换功能，切换事件监听等，需要依赖element模块
		});
	</script> 
	<script type="text/javascript">
	
	function getPath() {  	     
	        return 'http://'+location.host;
	}
	</script>
	<script type="text/javascript" src="../layui/lay/modules/layer.js"></script>
	<script type="text/javascript" src="../layui/layer.ext.js"></script>
      <script type="text/javascript">
     
    	  $("#submit").click(function(){
    		 
        	  var b=$("#DWZH").val();
        	  var c=$("#ylsjh").val();
        	  var d=$("#dxyz").val();
        	  var e=$('input:checked[name="ck"]:checked').val();
        	  var xp=$("#password").val();
        	  var jp=$("#qpassword").val();
            
        		  if(b=="" || b==null){  
        			   layer.alert('单位账号不能为空！');	    		  
        		  }
        		  else if(c=="" || c==null){
        			   layer.alert('手机号码不能为空！');     		  
        		  }
        		   else if(d=="" || d==null){
        			   layer.alert('短信验证码不能为空！');     		  
        		  }
        		   else if(xp!=jp){
        			   layer.alert('两次密码输入不一致！');     		  
        		  }
        		   else if(jp==""||jp==null){
        			   layer.alert('确认密码不能为空！');     		  
        		  }
        		   else if(xp=="" || xp==null){
        			   layer.alert('密码不能为空！');     		  
        		  }else if(e==null || e==""){
               		 layer.alert('您还没同意延边州住房公积金个人网上业务平台服务协议!');
               	  }else if(xp.length < 6){
               	  	   layer.alert("密码不能小于6位！"); 
               	  }else if(c.length < 11 && c.length > 11){
               	  	   layer.alert("请填写正确的手机号！"); 
        		  }else if(b!="" && c!="" && d!="" && (e!="" || e!=null) && xp==jp && xp>5){
						$.ajax({
							url : getPath()+'/wsyyt/zccontroller/dwzc',
							method : 'post',
							dataType : 'JSON',
							data: {'gjjzh':b,'ylsjh':c,'dxyz':d,'password':xp},
							success : function(result) {
								var code = result.code;
								if(code==0){
									
									layer.alert('注册成功', {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								      ,btn: ['确认','取消'] //按钮
								      ,icon: 6    // icon
								      ,yes:function(){
								         window.location.href =getPath()+'/wsyyt/login/login.html';
								      }
								     ,btn2:function(){
								         window.location.href =getPath()+'/wsyyt/login/login.html';
								     }});	
								}else{		
									layer.alert(result.CW, {
								      skin: 'layui-layer-molv' //样式类名  自定义样式
								     ,closeBtn: 1    // 是否显示关闭按钮
								      ,anim: 1 //动画类型
								      ,btn: ['确认','取消'] //按钮
								      ,icon: 5    // icon
								      ,yes:function(){
								         window.location.href =getPath()+'/wsyyt/login/DW_zc.html';
								      }
								     ,btn2:function(){
								         window.location.href =getPath()+'/wsyyt/login/DW_zc.html';
								     }});	
								}
							}
					});		
			};
	});  
    	  $("#fs").click(function(){
    		 
        	  var b=$("#DWZH").val();
        	  var c=$("#ylsjh").val();
            
        		  if(b=="" || b==null){
        			   layer.alert('单位账号不能为空！');       		  
        		  }
        		  else if(c=="" || c==null){
        			   layer.alert('手机号不能为空！');  
        		  }else if(c.length>11 || c.length<11){
        			   alert("请输入正确的手机号！");  
        		  }else if(b!="" && c!="" && c.length==11){
						$.ajax({
							url : getPath()+'/wsyyt/zccontroller/dwdx',
							method : 'post',
							dataType : 'JSON',
							data: {'DWZH':b,'SJHM':c},
							success : function(result) {
								var code = result.code;
								if(code==0){
										layer.alert('发送成功');
								}else{		
										layer.alert(result.CW);
								}
							}
					});		
			};
	});
	$("#cz").click(function(){
		window.location.href =getPath()+'/wsyyt/login/login.html';
	});
      </script>
</body>
</html>